#include <stdio.h>
#include <SOIL/SOIL.h>

const unsigned char image[] = {
	0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52,
	0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x08, 0x06, 0x00, 0x00, 0x00, 0x8D, 0x6F, 0x26,
	0xE5, 0x00, 0x00, 0x00, 0x06, 0x62, 0x4B, 0x47, 0x44, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xA0,
	0xBD, 0xA7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x2E,	0x23, 0x00,
	0x00, 0x2E, 0x23, 0x01, 0x78, 0xA5, 0x3F, 0x76, 0x00, 0x00, 0x00, 0x07, 0x74, 0x49, 0x4D, 0x45,
	0x07, 0xE2, 0x0C, 0x1A, 0x13, 0x27, 0x38, 0x81, 0xAB, 0x5D, 0x01, 0x00, 0x00, 0x00, 0x2C, 0x49,
	0x44, 0x41, 0x54, 0x08, 0xD7, 0x63, 0xE0, 0xCD, 0x62, 0xB8, 0xCD, 0xC0, 0xC0, 0xC0, 0x80, 0x44,
	0xEF, 0x62, 0x82, 0x31, 0x18, 0x90, 0x00, 0x13, 0x03, 0x03, 0x03, 0xC3, 0xE7, 0x69, 0x0C, 0x6E,
	0x0C, 0x84, 0x00, 0x23, 0x5B, 0xDF, 0xD1, 0xDB, 0xE8, 0x82, 0x00, 0x54, 0x88, 0x09, 0x0F, 0x5F,
	0x6F, 0x81, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82
};

int main() {
	int w, h;
	unsigned char* data = SOIL_load_image_from_memory(image, sizeof(image)/sizeof(image[0]), &w, &h, 0, SOIL_LOAD_RGBA);
	
	if(data == NULL){
		printf("error\n");
		return 1;
	}
		
	SOIL_free_image_data(data);
	printf("ok\n");
	return 0;
}
